package com.fjw.service.impl;

import com.fjw.mapper.PostRecordMapper;
import com.fjw.pojo.PostRecord;
import com.fjw.service.PostRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostRecordServiceImpl implements PostRecordService {

    @Autowired
    private PostRecordMapper postRecordMapper;

    @Override
    public void add(PostRecord postRecord) {
        postRecordMapper.add(postRecord);
    }

    @Override
    public PostRecord findById(Integer id) {
        return postRecordMapper.findById(id);
    }

    @Override
    public List<PostRecord> findByCv_id(Integer cv_id) {
        return postRecordMapper.findByCv_id(cv_id);
    }

    @Override
    public List<PostRecord> findByArticle_id(Integer article_id) {
        return postRecordMapper.findByArticle_id(article_id);
    }

    @Override
    public PostRecord findByCv_idAndArticle_id(Integer cv_id, Integer article_id) {
        return postRecordMapper.findByCv_idAndArticle_id(cv_id,article_id);
    }

    @Override
    public void updateById(Integer id, String advice) {
        postRecordMapper.updateById(id,advice);
    }
}
